package com.xj.center.manager.service.kafka;

import com.xj.common.bean.constant.Common;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

/**
* 类说明 接收驱动层发送过来的数据，进行处理
*/
@Component
public class DeviceEventConsumer {

    // 消费监听
    @KafkaListener(topics = {Common.KAFKA.TOPIC_EXCHANGE_DEVICE_EVENT},groupId = "${deviceEventGroup}")
    public void onMessage(ConsumerRecord<?, ?> record, Acknowledgment ack){

        //注意处理完需要同步
        ack.acknowledge();
    }

}
